package com.wcl.hencodertest;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.blankj.utilcode.util.Utils;

/**
 * @项目名： HenCoderTest
 * @包名： com.wcl.hencodertest
 * @文件名: Utlt
 * @创建者: kilin
 * @创建时间: 2020/4/17 19:16
 * @描述： TODO
 */
public class Util {

    public static Bitmap getAvatar(int width) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeResource(Utils.getApp().getResources(), R.drawable.pic, options);
        options.inJustDecodeBounds = false;
        options.inDensity = options.outWidth;
        options.inTargetDensity = width;
        return BitmapFactory.decodeResource(Utils.getApp().getResources(), R.drawable.pic, options);
    }
}
